/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package puntoventa.modelo;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author infor
 */
@Entity
@Table(name = "menus", catalog = "pv", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Menus.findAll", query = "SELECT m FROM Menus m"),
    @NamedQuery(name = "Menus.findByIdMenus", query = "SELECT m FROM Menus m WHERE m.idMenus = :idMenus"),
    @NamedQuery(name = "Menus.findByNombreMenus", query = "SELECT m FROM Menus m WHERE m.nombreMenus = :nombreMenus")})
public class Menus implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_menus")
    private Integer idMenus;
    @Column(name = "nombre_menus")
    private String nombreMenus;
    @OneToMany(mappedBy = "idMenus")
    private List<Formularios> formulariosList;

    public Menus() {
    }

    public Menus(Integer idMenus) {
        this.idMenus = idMenus;
    }

    public Integer getIdMenus() {
        return idMenus;
    }

    public void setIdMenus(Integer idMenus) {
        Integer oldIdMenus = this.idMenus;
        this.idMenus = idMenus;
        changeSupport.firePropertyChange("idMenus", oldIdMenus, idMenus);
    }

    public String getNombreMenus() {
        return nombreMenus;
    }

    public void setNombreMenus(String nombreMenus) {
        String oldNombreMenus = this.nombreMenus;
        this.nombreMenus = nombreMenus;
        changeSupport.firePropertyChange("nombreMenus", oldNombreMenus, nombreMenus);
    }

    public List<Formularios> getFormulariosList() {
        return formulariosList;
    }

    public void setFormulariosList(List<Formularios> formulariosList) {
        this.formulariosList = formulariosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMenus != null ? idMenus.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Menus)) {
            return false;
        }
        Menus other = (Menus) object;
        if ((this.idMenus == null && other.idMenus != null) || (this.idMenus != null && !this.idMenus.equals(other.idMenus))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "puntoventa.formulario.Menus[ idMenus=" + idMenus + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
